* as the first, regardless of the values of $db and $groups
* @param string $name Name to assign to the database connection
* @param int $db One of the DB_* constants
- * @param array $groups Query groups
+ * @param string|string[] $groups Query groups
* @return IDatabase
*/
public function getNamedDB( $name, $db, $groups ) {
* See ApiQuery::getNamedDB() for more information
* @param string $name Name to assign to the database connection
* @param int $db One of the DB_* constants
- * @param array $groups Query groups
+ * @param string|string[] $groups Query groups
* @return IDatabase
*/
public function selectNamedDB( $name, $db, $groups ) {
*/
class ApiQueryWatchlist extends ApiQueryGeneratorBase {
+ /** @var CommentStore */
private $commentStore;
public function __construct( ApiQuery $query, $moduleName ) {
private function extractOutputData( WatchedItem $watchedItem, array $recentChangeInfo ) {
/* Determine the title of the page that has been changed. */
- $title = Title::makeTitle(
- $watchedItem->getLinkTarget()->getNamespace(),
- $watchedItem->getLinkTarget()->getDBkey()
- );
+ $title = Title::newFromLinkTarget( $watchedItem->getLinkTarget() );
$user = $this->getUser();
/* Our output data. */
// get a reference to the mock object.
MessageCache::singleton()->getParser();
$restore = $this->executeSetupSnippets( [ 'wgParser' => new ParserTestMockParser ] );
- $status = $page->doEditContent(
- ContentHandler::makeContent( $text, $title ),
- '',
- EDIT_NEW | EDIT_INTERNAL
- );
- $restore();
+ try {
+ $status = $page->doEditContent(
+ ContentHandler::makeContent( $text, $title ),
+ '',
+ EDIT_NEW | EDIT_INTERNAL
+ );
+ } finally {
+ $restore();
+ }
if ( !$status->isOK() ) {
throw new MWException( $status->getWikiText( false, false, 'en' ) );